/**
 * 
 */
package websocket.echoserver;

import com.babukuma.commons.websocket.SimpleWebSocketHandler;

/**
 * @author babukuma
 * 
 */
public class EchoHandler extends SimpleWebSocketHandler {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.babukuma.commons.websocket.SimpleWebSocketHandler#onMessage(java.
	 * lang.String)
	 */
	@Override
	public void onMessage(String message) {
		send(message);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.babukuma.commons.websocket.WebSocketHandler#onClose()
	 */
	@Override
	public void onClose() {
		System.out.println("close");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.babukuma.commons.websocket.WebSocketHandler#onError(java.lang.Throwable
	 * )
	 */
	@Override
	public void onError(Throwable e) {
		e.printStackTrace();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.babukuma.commons.websocket.WebSocketHandler#onOpen()
	 */
	@Override
	public void onOpen() {
		System.out.println("open");
	}
}
